package info.techgeek.labs.threads;

class MyRunnable implements Runnable {
	
	char c;

		private MyRunnable(Thread thread) {

		}
	
		// override run() method in interface
		public void run() {
		    for(int i=0; i<100; i++) {
		        System.out.println(c);
		        
		        
		        try{ 
		           Thread.sleep((int)(Math.random() * 10));
		        } catch( InterruptedException e ) {
		            System.out.println("Interrupted Exception caught");
		        }
		    }
			
	        System.out.println("Running");
		}   
	   
	   MyRunnable(char c) {
		    this.c = c;
		}  
	   
	   public static void main(String[] args) {

		   MyRunnable bt = new MyRunnable('!');
		   MyRunnable bt1 = new MyRunnable('*');                

		    // start RunBasicThread objects as threads
		    new Thread(bt).start();    
		    new Thread(bt1).start();
		}

	}
